//
//  YMVBaseModel.m
//  STL_ Animation
//
//  Created by DJtd on 16/4/3.
//  Copyright © 2016年 STL. All rights reserved.
//

#import "YMVBaseModel.h"

@implementation YMVBaseModel


- (instancetype)initWithDataSource:(NSDictionary *)dataSource
{
    self = [super init];
    if (self) {
        
        [self setValuesForKeysWithDictionary:dataSource];
        NSMutableArray *array = [NSMutableArray arrayWithCapacity:0];
        
        for (NSDictionary *dic in self.videos) {
            HomePageBaseModel *modle = [[HomePageBaseModel alloc] initWithDataSource:dic];
            [array addObject:modle];
        }
        
        self.videos = [NSArray arrayWithArray:array];
    }
    return self;
}
- (void)setValue:(id)value forUndefinedKey:(NSString *)key {
    if ([key isEqualToString:@"id"]) {
        __id = value;
    }
    if ([key isEqualToString:@"creator"]) {
        self.creatorModel = [[YMVCreatorModel alloc] init];
        [self.creatorModel setValuesForKeysWithDictionary:value];
    }
    if ([key isEqualToString:@"description"]) {
        _descriptionModel = value;
    }
}
@end






